﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="ContentMaster.master" CodeFile="AccountSettings.aspx.cs" Inherits="AccountSettings" %>
<%@ OutputCache Duration="86400" VaryByParam="None" %>

    <asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="css/accountSettings.css" rel="stylesheet" /> <!-- Using accountSettings.css as stylesheet -->
    <title>Web Project</title>
</head>
<body>
    <form id="form1" > <!-- Account settings, so the user can change various information about his profile: password,email,credit card,profile button and delete account -->
     <div>
         <div id="changeemaildiv"> <!-- Controls used to change user email -->
         <asp:Label ID="changeEmailLabel" CssClass="emaillabel" runat="server" Text="Change Your Email adress"></asp:Label>
         <asp:TextBox ID="emailTextbox" CssClass="emailbox" placeholder="Enter your email" runat="server"></asp:TextBox>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator1" CssClass="validationemail" display="Dynamic" runat="server" ErrorMessage=" *Please input valid Email" ToolTip="Please enter Email" ValidationExpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$" ValidationGroup="changeemail" ControlToValidate="emailTextbox"></asp:RegularExpressionValidator>
         <asp:RequiredFieldValidator ID="RequiredFieldValidator3" CssClass="validationemail" display="Dynamic" runat="server" ErrorMessage=" *Email Adress required" ToolTip="Please enter Email" ControlToValidate="emailTextbox" ValidationGroup="changeemail"></asp:RequiredFieldValidator>
         <asp:Button ID="changeEmail" CssClass="emailbutton" runat="server" Text="Change Email" ValidationGroup="changeemail" OnClick="changeEmail_Click" />
     </div>

     <div id="changepassdiv"> <!-- Controls used to change user password -->
         <asp:Label ID="newPasswordLabel" CssClass="newpasswordlabel" runat="server" Text="New password"></asp:Label>
         <asp:TextBox ID="newPasswordBox" MaxLength="16" CssClass="newpasswordbox" placeholder="New password" runat="server"></asp:TextBox>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator6" CssClass="validationpassword" display="Dynamic" runat="server" ControlToValidate="newPasswordBox" ErrorMessage=" *Minimal length of password is 6 characters" ValidationExpression=".{6}.*" ValidationGroup="changepassword"></asp:RegularExpressionValidator>
         <asp:CompareValidator ID="CompareValidator1" CssClass="validationpassword" runat="server" ControlToCompare="repeatpasswordbox" display="Dynamic" ControlToValidate="newpasswordbox" ErrorMessage=" *Password missmatch" ValidationGroup="changepassword"></asp:CompareValidator>
         <asp:RequiredFieldValidator ID="RequiredFieldValidator4" CssClass="validationpassword" display="Dynamic" runat="server" ErrorMessage=" *Old password required" ToolTip="Old password required" ControlToValidate="oldPasswordBox" ValidationGroup="changepassword"></asp:RequiredFieldValidator>
         <asp:RequiredFieldValidator ID="RequiredFieldValidator5" CssClass="validationpassword" display="Dynamic" runat="server" ErrorMessage=" *New password required" ToolTip="new password required" ControlToValidate="newPasswordBox" ValidationGroup="changepassword"></asp:RequiredFieldValidator>
         <asp:RequiredFieldValidator ID="RequiredFieldValidator6" CssClass="validationpassword" display="Dynamic" runat="server" ErrorMessage=" *Repeat password required" ToolTip="repeat password required" ControlToValidate="repeatPasswordBox" ValidationGroup="changepassword"></asp:RequiredFieldValidator>
         <asp:Label ID="oldPasswordLabel" CssClass="oldpasswordlabel" runat="server" Text="Old password"></asp:Label>
         <asp:TextBox ID="oldPasswordBox" MaxLength="16" CssClass="oldpasswordbox" placeholder="Old password" runat="server"></asp:TextBox>
         <asp:Label ID="repeatPasswordLabel" CssClass="repeatpasswordlabel" runat="server" Text="Repeat password"></asp:Label>
         <asp:TextBox ID="repeatPasswordBox" MaxLength="16" CssClass="repeatpasswordbox" placeholder="Repeat password" runat="server" ValidationGroup="changepassword"></asp:TextBox>
         <asp:Button ID="changePassButton" CssClass="passbutton" runat="server" Text="Change Password" ValidationGroup="changepassword" OnClick="changePassButton_Click" />
        
     </div>

     <div id="profilediv"> <!-- Controls used to change profile image -->
         <asp:ImageButton ID="profilePic" CssClass="profimage" runat="server" />
         <asp:FileUpload ID="pictureUploader" CssClass="fileupload" runat="server" />
         <asp:RegularExpressionValidator ID="RegularExpressionValidator5" CssClass="validationprofile" display="Dynamic" runat="server" ErrorMessage=" *Only jpg and png files are allowed" ControlToValidate="pictureUploader" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpg|.JPG|.png|.PNG)$" ValidationGroup="profilepic" />
         <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="validationprofile" display="Dynamic" runat="server" ErrorMessage=" *Please choose a file" ControlToValidate="pictureUploader" ValidationGroup="profilepic"></asp:RequiredFieldValidator>
         <asp:Button ID="profileButton" CssClass="profilebutton" runat="server" Text="Change Picture" OnClick="profileButton_Click" ValidationGroup="profilepic" />    
     </div>

     </div>  
        <asp:Button ID="deleteButton" CssClass="deletebutton" runat="server" Text="Delete Account" OnClick="deleteButton_Click" /> <!-- Button to permanently delete account -->
      </form>

      <div id="changecarddiv"> <!-- Controls used to change credit card information -->
           <asp:Label ID="cardLabel" CssClass="cardTypelabel" runat="server" Text="Card type"></asp:Label>
           <asp:DropDownList ID="cardTypeList" CssClass="cardlist" runat="server" Height="23px" Width="148px">
           <asp:ListItem>Visa</asp:ListItem>
           <asp:ListItem>Mastercard</asp:ListItem>
           </asp:DropDownList>
           <br />
           <br />
           <asp:Label ID="cardHolderLabel" runat="server" cssClass="cardholderlabel" Text="Cardholder"></asp:Label>
           <asp:TextBox ID="cardHolderBox" runat="server" cssClass="cardholderbox" ToolTip="Please input name of card holder" placeholder="Name of cardholder" ></asp:TextBox>
           <asp:RegularExpressionValidator ID="RegularExpressionValidator3" CssClass="validationcard" display="Dynamic" runat="server" ControlToValidate="cardHolderBox" ErrorMessage=" *Only alphabetical characters" ValidationExpression="^[a-zA-ZåäöÅÄÖ ]+$" ValidationGroup="cregister"></asp:RegularExpressionValidator>
           <asp:RequiredFieldValidator ID="RequiredFieldValidator2" CssClass="validationcard" display="Dynamic" runat="server" ErrorMessage=" *Card Holder required" ValidationGroup="cregister" ControlToValidate="cardHolderBox"></asp:RequiredFieldValidator>
           <asp:RequiredFieldValidator ID="RequiredFieldValidator7" CssClass="validationcard" display="Dynamic" runat="server" ErrorMessage=" *CVC code required" ValidationGroup="cregister" ControlToValidate="cvcBox"></asp:RequiredFieldValidator>
           <asp:RequiredFieldValidator ID="RequiredFieldValidator8" CssClass="validationcard" display="Dynamic" runat="server" ErrorMessage=" *Card number required" ValidationGroup="cregister" ControlToValidate="creditCardNumberBox"></asp:RequiredFieldValidator>
           <asp:Label ID="creditnumberLabel" runat="server" cssClass="creditnumberlabel" Text="Credit number"></asp:Label>
           <asp:TextBox ID="creditCardNumberBox" MaxLength="16" runat="server" ToolTip="please input card number" CssClass="creditnumberbox" placeholder="Credit card number" ></asp:TextBox>
           <asp:RegularExpressionValidator ID="RegularExpressionValidator2" CssClass="validationcard" display="Dynamic" runat="server" ControlToValidate="creditCardNumberBox" ErrorMessage=" *Enter correct range of numbers (16)" ValidationExpression="[0-9]{16,}" ValidationGroup="cregister"></asp:RegularExpressionValidator>
           <br />
           <asp:Label ID="expirationDateLabel" runat="server" cssClass="expirationDateLabel" Text="Expiration Date"></asp:Label>
           
           <asp:DropDownList ID="expireMonthList" CssClass="expmonth" runat="server">
           <asp:ListItem>01</asp:ListItem>
           <asp:ListItem>02</asp:ListItem>
           <asp:ListItem>03</asp:ListItem>
           <asp:ListItem>04</asp:ListItem>
           <asp:ListItem>05</asp:ListItem>
           <asp:ListItem>06</asp:ListItem>
           <asp:ListItem>07</asp:ListItem>
           <asp:ListItem>08</asp:ListItem>
           <asp:ListItem>09</asp:ListItem>
           <asp:ListItem>10</asp:ListItem>
           <asp:ListItem>11</asp:ListItem>
           <asp:ListItem>12</asp:ListItem>
           </asp:DropDownList>

            <asp:DropDownList ID="expireYearList" CssClass="expyear" runat="server">
            <asp:ListItem>2013</asp:ListItem>
            <asp:ListItem>2014</asp:ListItem>
            <asp:ListItem>2015</asp:ListItem>
            <asp:ListItem>2016</asp:ListItem>
            <asp:ListItem>2017</asp:ListItem>
            <asp:ListItem>2018</asp:ListItem>
            <asp:ListItem>2019</asp:ListItem>
            <asp:ListItem>2020</asp:ListItem>
            <asp:ListItem>2021</asp:ListItem>
            <asp:ListItem>2022</asp:ListItem>
            <asp:ListItem>2023</asp:ListItem>
            <asp:ListItem>2024</asp:ListItem>
            <asp:ListItem>2025</asp:ListItem>
            </asp:DropDownList>

            <asp:Label ID="cvcLabel" runat="server" cssClass="cvclabel" Text="CVC"></asp:Label>
            <asp:TextBox ID="cvcBox" MaxLength="3" runat="server" cssClass="cvcbox" Width="117px" placeholder="Enter CVC code"></asp:TextBox> 
            <a href="" <span title="the CVC code can be found on the back of your credit card, the three last digits">what is this?</span></a>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" CssClass="validationcard" display="Dynamic" runat="server" ControlToValidate="cvcBox" ErrorMessage=" *Enter correct range of numbers (3)" ValidationExpression="[0-9]{3}" ValidationGroup="cregister"></asp:RegularExpressionValidator>
            <asp:Button ID="changeCardButton" CssClass="changecardbutton" runat="server" Text="Change card" ValidationGroup="cregister" OnClick="changeCardButton_Click" />
            <br />
            <br />
       </div>
       </asp:Content>

       <asp:Content ID="Content2" runat="server" contentplaceholderid="ContentPlaceHolder2">
       <div class="wrappernav"> <!-- Navigation bar for the information links -->
       <div class="container"><ul class="menu"> <!-- class="menu" used to style the nav bar -->
            <li><a href="contentpage.aspx">Home</a></li>
            <li><a href="About.aspx">About</a></li>
            <li><a href="Contact.aspx">Contact</a></li>
            <li><a href="Faq.aspx">FAQ</a></li>
            <li><a href="Report.aspx">Report</a></li>
            </ul>
      </div> 
      </div>
</body>
</html>
</asp:Content> 